﻿using System.Security.Cryptography;
using System.Text;

namespace ylyfDataCommon.Cypher
{
    public class SHA1Provider:CypherProvider
    {
        public override string Encryption(string str, string KEY = null, string IV = null)
        {
            var buffer = Encoding.UTF8.GetBytes(str);
            var data = SHA1.Create().ComputeHash(buffer);

            var sb = new StringBuilder();
            foreach (var t in data)
            {
                sb.Append(t.ToString("x2"));
            }

            return sb.ToString();
        }
    }
}